import java.util.Scanner;

public class HelloWorld {
    public static void main(String[] args) {
        Scanner scn = new Scanner(System.in);
        int n =scn.nextInt();
        int num=0;
        for (int i = 1; i <= n; i++) {
            int ret=1;
            for (int j = 1; j <= i; j++) {
                ret*=j;
            }
            num+=ret;
        }
        System.out.println(num);
    }
    public static void main3(String[] args) {
        int i=1;
        while(i<=100){
            if(i%3==0&&i%5==0){
                System.out.println(i);
            }
            i++;
        }
    }
    public static void main2(String[] args) {
        while(true) {
            Scanner num = new Scanner(System.in);
            int n = num.nextInt();
            int x = 1;
            int y = 1;
            int ret1 = 1;
            int ret2 = 0;
            while (x <= n) {
                while (y <= x) {
                    ret1 *= y;
                    y++;
                }
                ret2 += ret1;
                x++;
            }
            System.out.println(ret2);
        }
    }
    public static void main1(String[] args) {
        for (int i = 0; i < 3000; i++) {
            boolean flg=i>0;
            while(flg){
                System.out.println(i+" I Love ZouYi"+","+"forever!");
                break;
            }
        }


    }
}
